<html>
  <head>
    <meta charset="UTF-8">
    <title>WebGPU CTS</title>
    <link
      id="favicon"
      rel="shortcut icon"
      type="image/png"
      href=""
    />
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
    <meta name="viewport" content="width=device-width" />
    <!-- Chrome Origin Trial token for https://gpuweb.github.io (see dev_server.ts for localhost tokens) -->
    <meta http-equiv="origin-trial" content="At6MXIsdbkOn9G7zcCbxYbgOwf4A8s3jBUW4cqnyDtzPnexBb1bdPkdDRtinADOTelA+/Fn3XEKutibMyzD0Kw0AAABQeyJvcmlnaW4iOiJodHRwczovL2dwdXdlYi5naXRodWIuaW86NDQzIiwiZmVhdHVyZSI6IldlYkdQVSIsImV4cGlyeSI6MTY0MzE1NTE5OX0=">
    <link rel="stylesheet" href="third_party/normalize.min.css" />
    <script src="third_party/jquery/jquery-3.3.1.min.js"></script>
    <style>
      body {
        font-family: monospace;
        min-width: 400px;
        margin: 0.5em;
      }
      * {
        box-sizing: border-box;
      }
      h1 {
        font-size: 1.5em;
        font-family: 'Poppins', sans-serif;
        height: 1.2em;
        vertical-align: middle;
      }
      .logo {
        height: 1.2em;
        float: left;
      }
      #info {
        font-family: monospace;
      }
      #resultsJSON {
        font-family: monospace;
        width: 100%;
        height: 15em;
      }

      #resultsVis {
        border-right: 1px solid gray;
      }

      /* tree nodes */

      .nodeheader {
        display: flex;
        width: 100%;
        padding: 0px 2px 0px 1px;
      }
      .nodeheader:hover {
        background: rgba(0, 0, 0, 0.1);
      }
      .subtreerun,
      .leafrun,
      .nodelink,
      .collapsebtn,
      .testcaselogbtn {
        display: inline-block;
        flex-shrink: 0;
        flex-grow: 0;
        vertical-align: top;
        background-color: #eee;
        background-repeat: no-repeat;
        background-position: center;
        border: 1px solid #888;
      }
      @media (pointer: fine) {
        .subtreerun,
        .leafrun,
        .nodelink,
        .collapsebtn,
        .testcaselogbtn {
          flex-basis: 24px;
          border-radius: 4px;
          width: 24px;
          height: 18px;
        }
      }
      @media (pointer: coarse) {
        .subtreerun,
        .leafrun,
        .nodelink,
        .collapsebtn,
        .testcaselogbtn {
          flex-basis: 36px;
          border-radius: 6px;
          width: 36px;
          height: 36px;
        }
      }
      .subtreerun {
        background-image: url();
      }
      .leafrun {
        background-image: url();
      }
      .nodelink {
        background-image: url();
      }
      .nodetitle {
        display: inline;
        flex: 10 0 4em;
      }
      .nodequery {
        position: absolute;
        left: 220px;

        font-weight: bold;
        background: transparent;
        border: none;
        padding: 2px;
        margin: 0 0.5em;
        width: calc(100vw - 260px);
      }
      .nodedescription {
        margin: 0 0 0 1em;
        color: gray;
        white-space: pre-wrap;
        font-size: 80%;
      }

      /* tree nodes which are subtrees */

      .subtree {
        margin: 3px 0 0 0;
        padding: 3px 0 0 3px;
        border-width: 1px 0 0;
        border-style: solid;
        border-color: #ddd;
      }
      .subtree::before {
        float: right;
        margin-right: 3px;
      }
      .subtree[data-status='fail'], .subtree[data-status='passfail'] {
        background: linear-gradient(90deg, #fdd, #fdd 16px, #fff 16px);
      }
      .subtree[data-status='fail']::before {
        content: "⛔"
      }
      .subtree[data-status='pass'] {
        background: linear-gradient(90deg, #cfc, #cfc 16px, #fff 16px);
      }
      .subtree[data-status='pass']::before {
        content: "✔"
      }
      .subtree[data-status='passfail']::before {
        content: "✔/⛔"
      }
      .subtree:hover {
        border-left-color: #000;
      }
      .subtree.multifile > .subtreechildren > .subtree.multitest,
      .subtree.multifile > .subtreechildren > .subtree.multicase {
        border-width: 2px 0 0 1px;
        border-color: #55f;
      }
      .subtree.multitest > .subtreechildren > .subtree.multicase,
      .subtree.multitest > .subtreechildren > .testcase {
        border-width: 2px 0 0 1px;
        border-color: #bbf;
      }
      .subtreechildren {
        margin-left: 9px;
      }

      /* tree nodes which are test cases */

      .testcase {
        padding: 3px;
        border-width: 1px 0 0 0;
        border-style: solid;
        border-color: gray;
        background: #bbb;
      }
      .testcase:first-child {
        margin-top: 3px;
      }
      .testcase::after {
        float: right;
        margin-top: -1.1em;
      }
      .testcase[data-status='fail'] {
        background: #fdd;
      }
      .testcase[data-status='fail']::after {
        content: "⛔"
      }
      .testcase[data-status='warn'] {
        background: #ffb;
      }
      .testcase[data-status='warn']::after {
        content: "⚠"
      }
      .testcase[data-status='pass'] {
        background: #cfc;
      }
      .testcase[data-status='pass']::after {
        content: "✔"
      }
      .testcase[data-status='skip'] {
        background: #eee;
      }
      .testcase .nodequery {
        font-weight: normal;
        width: calc(100vw - 275px);
      }
      .testcasetime {
        white-space: nowrap;
        text-align: right;
        flex: 1 0 5.5em;
      }
      .testcaselogs {
        margin-left: 6px;
        width: calc(100% - 6px);
        border-width: 0 0px 0 1px;
        border-style: solid;
        border-color: gray;
        background: white;
      }
      .testcaselog {
        display: flex;
      }
      .testcaselog:nth-child(odd) {
        background: #fff;
      }
      .testcaselog:nth-child(even) {
        background: #f8f8f8;
      }
      .testcaselogbtn {
        background-image: url();
      }
      .testcaselogtext {
        flex: 1 0;
        font-size: 10pt;
        white-space: pre-wrap;
        word-break: break-word;
        margin: 0;
        color: #666;
      }
      .testcaselogtext::first-line {
        color: #000;
      }

      @media only screen and (max-width: 600px) {
        .subtreechildren {
          margin-left: 2px;
        }
        .testcaselogs {
          margin-left: 2px;
          width: calc(100% - 2px);
        }
        .nodequery {
          position: relative;
          left: 0;
          width: 100%;
        }
      }
    </style>
  </head>
  <body>
    <h1><img class="logo" src="webgpu-logo-notext.svg">WebGPU Conformance Test Suite</h1>
    <p>
      <input type=button id=expandall value="Expand All (slow!)">
    </p>

    <div id="info"></div>
    <div id="resultsVis"></div>

    <p>
      <input type="button" id="copyResultsJSON" value="Copy results as JSON">
    </p>

    <script type="module" src="../out/common/runtime/standalone.js"></script>
  </body>
</html>
